﻿/* ==============================================================================
 * 功能描述：UIDef  
 * 
 * 创 建 者：郑镇泉
 * 
 * 创建日期：2016/4/3 23:12:30
 * ==============================================================================*/

using System;
using UnityEngine;
using System.Collections;

#region UI枚举

/// <summary>
/// UI状态
/// </summary>
public enum Enum_UIState
{
    None,
    Init,
    Open,
    Close
}

/// <summary>
/// UI类型
/// </summary>
public enum Enum_UIType
{
    None,
    LoginPanel,
    CharacterMainPanel,
    CharacterPanel,
    SkillPanel,
    MainPanel,
    BattlePanel,
    TaskPanel,
    GameOverPanel,
    GamePassPanel
}

/// <summary>
/// 打开UI的类型
/// </summary>
public enum Enum_UIOpenType
{
    None,
    OpenSelf,
    CloseUI,
    CloseOthers,
}

/// <summary>
/// 点击类型
/// </summary>
public enum Enum_TouchEventType
{
    OnClick,
    OnDoubleClick,
    OnDown,
    OnUp,
    OnEnter,
    OnExit,
    OnSelect,
    OnUpdateSelect,
    OnDeSelect,
    OnDragBegin,
    OnDrag,
    OnDragEnd,
    OnDrop,
    OnScroll,
    OnMove,
}

#endregion

#region UI委托

/// <summary>
/// UI状态改变委托
/// </summary>
public delegate void OnUIStateChangedDe(Enum_UIState oldState,Enum_UIState newState,params object[] objects);

public delegate void OnTouchEventHandle(GameObject _listener, object _args, params object[] _params);
#endregion

namespace ZZQFrameWork
{
    public class UIDef
    {
        /// <summary>
        /// 根据ui类型获取ui名称
        /// </summary>
        /// <param name="type">ui类型</param>
        /// <returns></returns>
        public static string GetUINameByUIType(Enum_UIType type)
        {
            //string name = String.Empty;
            //switch (type)
            //{
                
            //}
            //return name;
            return type.ToString();
        }

        /// <summary>
        /// 根据ui类型获取ui脚本
        /// </summary>
        /// <param name="type">ui类型</param>
        /// <returns></returns>
        public static Type GetUIScriptByUIType(Enum_UIType type)
        {
            Type script = null;
            switch (type)
            {
                case Enum_UIType.LoginPanel:
                    script = typeof (LoginPanel);break;
                case Enum_UIType.CharacterMainPanel:
                    script = typeof(CharacterMainPanel); break;
                case Enum_UIType.BattlePanel:
                    script = typeof(BattlePanel); break;
                case Enum_UIType.TaskPanel:
                    script = typeof(TaskPanel); break;
                case Enum_UIType.GamePassPanel:
                    script = typeof(GamePassPanel); break;
                case Enum_UIType.GameOverPanel:
                    script = typeof(GameOverPanel); break;
            }
            return script;
        }
    }
}